﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo2
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("请输入第一个整数");
            int a = int.Parse(Console.ReadLine());
            Console.WriteLine("请输入加减乘除操作符之一");
            string  s = Console.ReadLine();
            Console.WriteLine("请输入第二个整数");
            int b = int.Parse(Console.ReadLine());
            Calculate c = null;
            switch (s)
            {
                case "+":
                    c = new NumSum(a, b);
                    break;
                case "-":
                    c = new NumSub(a, b);
                    break;
                case "*":
                    c = new NumMul(a, b);
                    break;
                case "/":
                    c = new NumDiv(a, b);
                    break;
                default:
                    break;
            }
            Console.WriteLine("result:" + MyRes(c));
        }

        private static int MyRes(Calculate c)
        {
            return c.DisplayResult();
        }
    }
}
